<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>课程编辑</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="text/javascript">
	function aaa(from){
		var name=from.name.value;
		var classHour=from.classHour.value;
		 var reg = /^[1-9]\d*$/;
		if(name.length==0){
			alert("课程名称必填");
			return false;
		}
		if(classHour.length==0){
			alert("课时必填");
			return false;
		}
		if(!reg.test(classHour)){
			alert("课时必须为正整数");
			return false;
		}
		return true;
	}
	function course() {
		window.location="course"
	}	
</script>
</head>
<body>
	<div class="ccc">
	<form action="course?method=save" method="post" onsubmit="return aaa(this)">
		<input type="hidden"  name="id" value="${model.id }">
		<p><label>课程名称：</label><input type="text" name="name" value="${model.name}"></p>
		<p><label>课时：</label><input type="text" name="classHour" value="${model.classHour}"></p>
		<p>
		<button type="submit"  data-text="提交">提交</button>
      	<button type="reset" data-text="重置">重置</button>
		<button onclick="course()">返回</button></p>
	</form>		
	</div>
	
</body>
</html>